package persistence;

import java.util.Set;

import cdautils.TriageTag;


/**
 * This class is used to create and persist TriageTag-objects from/to persistence.
 * @author Felix
 *
 */
public interface DAOTriageTag {
	
	/**
	 * Returns a TriageTag-entity (newest) with given UID from database.
	 * 
	 * @param uid UID of requested TriageTage
	 * @return TriageTag with given uid.
	 * @throws DAOException In case of peristence based errors. (depends on implementation)
	 */
	 TriageTag getTag(String uid) throws DAOException;
	 
	 /**
	  * Returns a Set of (newest) TriageTags. If params are null all Tags will be returned unfiltered.
	  * If triagekategorie is not null, only tags with matching triagekategorie will be stored in the Set.
	  * If behandlung is not null, only tags with matching behandlung will be stored in the Set.
	  * 
	  * @param triagekategorie Tags with triagekategorie to look for. Null for unfiltered search.
	  * @param behandlung Tags with behandlungsstatus to look for. Null for unfiltered search.
	  * @return A Set of (newest) TriageTags, filtered using the given param-combination.
	  */
	 Set<TriageTag> getTags(TriageTag.TriageCategory triagekategorie, TriageTag.TreatmentStatus behandlung) throws DAOException;
	 
	 /**
	  * Persists given TriageTag to database. If document_nr is outdated, this function
	  * will try to "integrate" its changes in the documents history and persist a new
	  * version of the TriageTag with included changes to database.
	  * 
	  * @param tag Instance of TriageTag to persist 
	 * @throws DAOException In case of peristence based errors. (depends on implementation)
	  */
	 void persist(TriageTag tag) throws DAOException;

}
